home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 326-350 / disk_329 / diskspeed / makeboxes.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  4KB  |  140 lines

  1. /*
  2.  *                          DiskSpeed v3.0
  3.  *                                by
  4.  *                           Michael Sinz
  5.  *
  6.  *             Copyright (c) 1989 by MKSoft Development
  7.  *
  8.  *            MKSoft Development
  9.  *            163 Appledore Drive
  10.  *            Downingtown, PA 19335
  11.  *
  12.  * Yes, this is yet another disk speed testing program, but with a few
  13.  * differences.  It was designed to give the most accurate results of the
  14.  * true disk performance in the system.  For this reason many of
  15.  * DiskSpeed's results may look either lower or higher than current disk
  16.  * performance tests.
  17.  *
  18.  * This program was thrown together in a few hours because I needed more
  19.  * accurate and consistent results for disk performance as seen from the
  20.  * application's standpoint.  This program has now served its purpose and
  21.  * I am now giving it to the rest of the Amiga world to play with as long
  22.  * as all of the files remain together in unmodified form.  (That is, the
  23.  * files DiskSpeed, DiskSpeed.info, DiskSpeed.c, DiskSpeedWindow.c,
  24.  * DiskSpeedWindow.h, MakeBoxes.c, MakeBoxes.h, StandardGadgets.c,
  25.  * StandardGadgets.h, RenderInfo.c, RenderInfo.h, DiskSpeed.doc, and
  26.  * MakeFile)
  27.  *
  28.  * Version 2.0 of this program added a few features and cleaned up the
  29.  * user interface.  I hope you like this...
  30.  *
  31.  * Version 3.0 of this program added the performance stress and cleaned up
  32.  * some parts of the older code.  (Fix to RenderInfo.c)
  33.  *
  34.  ******************************************************************************
  35.  *                                          *
  36.  *    Reading legal mush can turn your brain into guacamole!              *
  37.  *                                          *
  38.  *        So here is some of that legal mush:                  *
  39.  *                                          *
  40.  * Permission is hereby granted to distribute this program's source          *
  41.  * executable, and documentation for non-commercial purposes, so long as the  *
  42.  * copyright notices are not removed from the sources, executable or          *
  43.  * documentation.  This program may not be distributed for a profit without   *
  44.  * the express written consent of the author Michael Sinz.              *
  45.  *                                          *
  46.  * This program is not in the public domain.                      *
  47.  *                                          *
  48.  * Fred Fish is expressly granted permission to distribute this program's     *
  49.  * source and executable as part of the "Fred Fish freely redistributable     *
  50.  * Amiga software library."                              *
  51.  *                                          *
  52.  * Permission is expressly granted for this program and it's source to be     *
  53.  * distributed as part of the Amicus Amiga software disks, and the          *
  54.  * First Amiga User Group's Hot Mix disks.                      *
  55.  *                                          *
  56.  ******************************************************************************
  57.  *
  58.  * Make border structures with the correct box info...
  59.  */
  60.  
  61. #include    <exec/types.h>
  62. #include    <intuition/intuition.h>
  63.  
  64. #include    "MakeBoxes.h"
  65.  
  66. /*
  67.  * Note:  The routines do fill in the '0' values even though
  68.  *      the array was, most likely, already zero'd
  69.  */
  70.  
  71. /*
  72.  * This function makes a top-left border array based on the
  73.  * x/y size of the box...
  74.  */
  75. VOID    FillTopLeft_Border(struct Border *bd,SHORT xSize,SHORT ySize)
  76. {
  77. register    SHORT    *xy;
  78.  
  79.     xy=bd->XY;
  80.     xy[0]=xSize-2;        xy[1]=0;
  81.     xy[2]=0;        xy[3]=0;
  82.     xy[4]=0;        xy[5]=ySize-1;
  83.     xy[6]=1;        xy[7]=ySize-2;
  84.     xy[8]=1;        xy[9]=1;
  85. }
  86.  
  87. /*
  88.  * This function makes a bottom-right border array based on the
  89.  * x/y size of the box...
  90.  */
  91. VOID    FillBottomRight_Border(struct Border *bd,SHORT xSize,SHORT ySize)
  92. {
  93. register    SHORT    *xy;
  94.  
  95.     xy=bd->XY;
  96.     xy[0]=1;        xy[1]=ySize-1;
  97.     xy[2]=xSize-1;        xy[3]=ySize-1;
  98.     xy[4]=xSize-1;        xy[5]=0;
  99.     xy[6]=xSize-2;        xy[7]=1;
  100.     xy[8]=xSize-2;        xy[9]=ySize-2;
  101. }
  102.  
  103. /*
  104.  * This function make a top-left double border array based on the
  105.  * x/y size of the box...
  106.  */
  107. VOID    FillTopLeftDouble_Border(struct Border *bd,SHORT xSize,SHORT ySize)
  108. {
  109. register    SHORT    *xy;
  110.  
  111.     xy=bd->XY;
  112.     xy[ 0]=0;        xy[ 1]=ySize-1;
  113.     xy[ 2]=0;        xy[ 3]=0;
  114.     xy[ 4]=xSize-2;        xy[ 5]=0;
  115.     xy[ 6]=xSize-3;        xy[ 7]=1;
  116.     xy[ 8]=1;        xy[ 9]=1;
  117.     xy[10]=1;        xy[11]=ySize-2;
  118.     xy[12]=2;        xy[13]=ySize-3;
  119.     xy[14]=2;        xy[15]=2;
  120. }
  121.  
  122. /*
  123.  * This function makes a bottom-right double border array based on the
  124.  * x/y size of the box...
  125.  */
  126. VOID    FillBottomRightDouble_Border(struct Border *bd,SHORT xSize,SHORT ySize)
  127. {
  128. register    SHORT    *xy;
  129.  
  130.     xy=bd->XY;
  131.     xy[ 0]=xSize-1;        xy[ 1]=0;
  132.     xy[ 2]=xSize-1;        xy[ 3]=ySize-1;
  133.     xy[ 4]=1;        xy[ 5]=ySize-1;
  134.     xy[ 6]=2;        xy[ 7]=ySize-2;
  135.     xy[ 8]=xSize-2;        xy[ 9]=ySize-2;
  136.     xy[10]=xSize-2;        xy[11]=1;
  137.     xy[12]=xSize-3;        xy[13]=2;
  138.     xy[14]=xSize-3;        xy[15]=ySize-3;
  139. }
  140.